#ifndef __COM_TYPEDEF_H_
#define __COM_TYPEDEF_H_


#include "Global.h"


#pragma pack(1) 
typedef union
{
    unsigned char tab[2];
    unsigned short packageNO;
}TYPEDEF_U16_DATA;

#pragma pack(1) 
typedef struct
{
    TYPEDEF_U16_DATA NO_tab;
    unsigned char data_tab[52];
}TYPEDEF_DATA;

#pragma pack(1) 
typedef union
{
    unsigned char data[54];
    TYPEDEF_DATA Data;
}TYPEDEF_UDATA;

#pragma pack(1) 
typedef union
{
  unsigned short data16;
  unsigned char data8_tab[2];
}TYPEDEF_U16;

#pragma pack(1) 
typedef union
{
  unsigned long data32;
  unsigned char data8_tab[4];
}TYPEDEF_U32;

#pragma pack(1) 
typedef struct
{
	unsigned short head;
	unsigned long crc32;
	unsigned char cmd;
	unsigned short len;
	TYPEDEF_UDATA udata;
}TYPEDEF_DATA_FORMAT;

#pragma pack(1) 
typedef union
{
    TYPEDEF_DATA_FORMAT data_format;
    unsigned char data_tabe[512];
}TYPEDEF_UDATA_FORMAT;


typedef struct
{
    unsigned char flg :1;
    unsigned char cnt :7;
}TYPEDEF_TIMEOUT_CNT;

typedef struct
{
	unsigned char get_handshake_ack :1;
	unsigned char get_ver_ack :2;
	unsigned char get_update_ver_info_ack :1;
	unsigned char get_update_package_info_ack :1;
	unsigned char get_update_package_ack :1;
	unsigned char get_update_status_ack :1;
	unsigned char resver :1;
}TYPEDEF_UPDATE_FLG;

typedef union
{
    unsigned long data;
    unsigned char data_tab[4]; 
}TYPEDEF_U32_DATA;




#endif

